
package com.market.web.utils;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;

public class ListUtils
{
    static public List convert(List list, Class source, Class target)
    {
        List l = new ArrayList();
        for (int i = 0; i < list.size(); i++)
        {
            Object o = list.get(i);
            Object to = BeanUtils.instantiateClass(target);
            BeanUtils.copyProperties(o, to);
            l.add(to);
        }
        return l;
    }
}
